﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Base;
using Corporation.News;

public partial class Member_News_NewsAdd : nspBase.MemberBasePge
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!CheckCookies())
        {
            Response.Redirect("../../login/login.aspx");
        }
    }
    protected void btnSave_Click(object sender, EventArgs e)
    {
        try
        {
            INews RNew = new RNews();
            TNews TNew = new TNews();
            int userid = int.Parse(GetCookie("UserID"));
            TNew.UserID = userid;
            TNew.Title = txtTitle.Text.Trim();
            TNew.Info =Common.ClearHtml(Detail.Value);
            RNew.Insert(TNew);
            ShowMessage("公司新闻添加成功！","News/NewsList.aspx");
        }
        catch (Exception ex)
        {
            ShowMessage("公司新闻添加失败！", "News/NewsList.aspx");
        }
    }
}
